/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.service.organization;
import com.alibaba.fastjson.JSONObject;
import com.qinyeit.serviceapp.entity.enums.PrintSettingOrderType;
import com.qinyetech.springstage.core.lang.QyMap;
import com.qinyetech.springstage.core.service.IBaseService;
import com.qinyeit.serviceapp.entity.PrintSettingOrder;

import java.util.Map;

/** 
 * ClassName: PrintSettingOrderService <br/> 
 * Function: 单据打印设置业务功能 <br/> 
 * date: 2019-03-04 16:15:43 <br/> 
 * 
 * @author liuwenjin
 * @version 1.0
 * @since JDK 1.8
 */
public interface PrintSettingOrderService extends IBaseService<PrintSettingOrder, Long>{


    /**
     * 获取打印类型的初始化数据
     * @param
     * @param merchantGroupId
     * @return
     */
    QyMap getPrintSettings( Long merchantGroupId);

    /**
     * 保存打印设置
     * @param data
     *          {
     *               "printType": 打印类型(回传[PrintSettingOrderType]枚举值)
     *              "title": 单据标题
     *              "orderExplain": 单据底部说明
     *              "dataSet": 动态数据设置是否打印, 这里回传一个code数组. 如: ['name', 'code', 'merchantId', ...]
     *              "dataTable":动态列数据设置是否打印 数组["name","code"]
     *          }
     * @param merchantGroupId
     */
    boolean saveData(JSONObject data, Long merchantGroupId);


    /**
     *
     * @param
     * @author mafeiyue
     * @date 2018-07-05
     * @return
     *     "order": 单据信息(包括明细)
     *     "print": 打印相关设置
     */
    /**
     * 根据某类型 读取打印单据的配置
     * @param printType 打印类型
     * @param merchantGroupId
     * @return
     */
    QyMap getPrintSettingsByType(PrintSettingOrderType printType,Long merchantGroupId);


}